<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>购买产品消费结算</title>
<meta name="decorator" content="default" />
<style type="text/css">
</style>
<script type="text/javascript">
$().ready(function(){
disableExitMenu();
});
</script>
</head>
<body>
	<div data-role="navbar">
		<ul>
			<c:if test="${member.menuState.hasNewCards}">
				<li><a href="${ctx}/cash/member/shoppingDetails">新开卡消费结算</a></li>
			</c:if>
			<c:if test="${member.menuState.hasRecharges}">
				<li><a href="${ctx}/cash/member/shoppingDetails/recharge">卡充值消费结算</a></li>
			</c:if>
			<c:if test="${member.menuState.hasProducts}">
				<li><a class="ui-btn-active" href="#">购买产品消费结算</a></li>
			</c:if>
			<c:if test="${member.menuState.hasCares}">
				<li><a href="${ctx}/cash/member/shoppingDetails/docare">手工护理消费结算</a></li>
			</c:if>
			<c:if test="${member.menuState.hasGifts}">
				<li><a href="${ctx}/cash/member/shoppingDetails/gift">赠品</a></li>
			</c:if>
		</ul>
	</div>
	<div class="container">
		<h2 style="text-align: center;">确认结算方式</h2>
		<div class="icon-buttons">
			<a href="${ctx}/cash/member/detail?id=${member.customer.id}"
				data-icon="back" data-iconpos="notext" data-inline="true"
				data-role="button"> 返回</a> <a data-role="button" data-inline="true"
				data-icon="check" data-iconpos="notext"
				href="${ctx}/cash/member/shoppingPayment?id=${member.customer.id}">结算</a>
		</div>
		<tags:message content="${message}" />
		<div data-role="fieldcontain">
			<label><strong>总计购买产品费用(元):</strong></label> <input id="totalMonney"
				type="text" readonly
				value="${member.payment.productsPayment.totalPay}" />
		</div>
		<div data-role="collapsible-set">
			<c:if
				test="${not empty member.shoppingCart.systemProducts or not empty member.shoppingCart.storeProducts}">
				<div id="collapsibleForNewCard" data-role="collapsible"
					data-collapsed="false">
					<h4>自选产品(${fn:length(member.shoppingCart.systemProducts)+fn:length(member.shoppingCart.storeProducts)})</h4>
					<table id="contentTableCardTimes" data-role="table"
						class="ui-responsive table-stroke">
						<thead>
							<tr>
								<th colspan="7" style="text-align:center;">选购产品结算</th>
							</tr>
							<tr>
								<th>产品名称</th>
								<th>产品规格</th>
								<th>数量</th>
								<th>零售单价</th>
								<th>结算单价</th>
								<th>合计</th>
								<th>确认付款方式</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${member.shoppingCart.systemProducts}"
								var="productCart">
								<tr>
									<td>${productCart.storeProduct.product.name}</td>
									<td>${productCart.storeProduct.product.spec}</td>
									<td>${productCart.count}</td>
									<td>${productCart.storeProduct.product.retail_price}</td>
									<td>${productCart.realCost}</td>
									<td>${productCart.realCostTotal}</td>
									<td>${productCart.payment.description}</td>
								</tr>
							</c:forEach>
							<c:forEach items="${member.shoppingCart.storeProducts}"
								var="productCart">
								<tr>
									<td>${productCart.storeProduct.storeSelfProduct.name}</td>
									<td>${productCart.storeProduct.storeSelfProduct.spec}</td>
									<td>${productCart.count}</td>
									<td>${productCart.storeProduct.storeSelfProduct.retail_price}</td>
									<td>${productCart.realCost}</td>
									<td>${productCart.realCostTotal}</td>
									<td>${productCart.payment.description}</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>
			</c:if>
			<c:if test="${not empty member.shoppingCart.solutionProducts}">
				<div id="collapsibleForNewCard" data-role="collapsible"
					data-collapsed="false">
					<h4>方案产品(${fn:length(member.shoppingCart.solutionProducts)})</h4>
					<table id="contentTableCardTimes" data-role="table"
						class="ui-responsive table-stroke">
						<thead>
							<tr>
								<th colspan="7" style="text-align:center;">选购产品结算</th>
							</tr>
							<tr>
								<th>产品名称</th>
								<th>产品规格</th>
								<th>数量</th>
								<th>零售单价</th>
								<th>结算单价</th>
								<th>合计</th>
								<th>确认付款方式</th>
							</tr>
						</thead>
						<tbody>
							<!-- Solution Products -->
							<c:forEach items="${member.shoppingCart.solutionProducts}"
								var="productCart">
								<tr>
									<td>${productCart.storeProduct.product.name}</td>
									<td>${productCart.storeProduct.product.spec}</td>
									<td>${productCart.count}</td>
									<td>${productCart.storeProduct.product.retail_price}</td>
									<td>${productCart.realCost}</td>
									<td>${productCart.realCostTotal}</td>
									<td>${productCart.payment.description}</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>
			</c:if>
		</div>
	</div>
	<br />
	<br />
	<br />
	<br />
	<br />

</body>
</html>
